The present invention relates to graphical programming and, more particularly, to a programming environment which simplifies construction of programs that are used to control concurrent operations within a system.
Currently, there are two types of implementations to deal with asynchronous events encountered in software programs. One implementation uses a state table to define actions that are to be taken for various events that occur during different states. The other implementation uses multiple wait loops interspersed in the linear flow of the controlling program.
In a pure state table application all of the actions to be taken are defined in a table. Each state may correspond to a number of events, and an action is defined for each state/event combination. Transitions from one state to another state are defined for asynchronous events. When an asynchronous event is detected, the system looks to the state table to determine what transition should be made or what action should be taken. A problem with the state table approach is the size of the table. In a complex system there can be hundreds of states and events. Typically, in a state table there is only one wait loop and a large data structure indicates the transitions among the states. The table essentially contains pointers to sections of code. Every time the system comes to a new state, it goes and executes that section of code. The code is non-interruptible and when it is completed, the system returns to the state table to wait for the next event to occur.
When moving through the data structure in state transitions, the program almost flows randomly. It is difficult to follow this long complicated data structure, thus increasing the complexity in programmers creating/modifying such software programs. Another problem with state tables is that they are difficult to understand. Although the state tables thoroughly specify the problem, state diagrams are not easily understood, thus further increasing the complexity involved with creating/modifying software programs.
In the multiple wait loop applications, instead of going back to a central state wait loop, the program has a more linear flow, thus somewhat aiding the readability of such programs. Typically, if there are any asynchronous events, the program will use a wait loop or wait process in the code. A positive result is that programs have more of a linear flow. The downside is that there can be dozens of these wait loops interspersed within the code. This is because everywhere the program expects an event to occur, it has to be able to handle a number of different events and corresponding actions. Accordingly, following such a wait loop method of the prior art may increase the overall length and complexity of the code, which may result in increased difficulty involved with creating/modifying/debugging such software code.
The present invention is directed to a graphical programming language which is adapted to simplify coding for programs that must handle asynchronous events in a system having concurrent operations. In a preferred embodiment, such a programming language is utilized to create programs that may control a system, such as telecommunications applications, in which events that affect program operation may occur at random times in a random order. Two or more of cooperative programs may be designed to run concurrently to control separate parts of a single system or to control related portions of two different systems. For instance, such cooperative programs may be capable of exchanging event information that is related to current conditions or actions in the system(s).
The programming language disclosed herein is adapted to run on a graphical development system, such as a processor-based computer system, that may include a display and data storage device, such as random access memory (RAM), hard drive, floppy drive, CD-ROM drive, tape drive, or any other suitable data storage device. Exemplary graphical development environments that may be implemented on such a computer system are disclosed in U.S. Pat. No. 5,946,485 entitled xe2x80x9cENHANCED GRAPHICAL DEVELOPMENT ENVIRONMENT FOR CONTROLLING PROGRAM FLOW,xe2x80x9d which issued from application Ser. No. 08/599,134, filed Feb. 9, 1996; co-pending and commonly assigned application Ser. No. 09/310,442, filed May 12, 1999, entitled xe2x80x9cENHANCED GRAPHICAL DEVELOPMENT ENVIRONMENT FOR CONTROLLING PROGRAM FLOW;xe2x80x9d and co-pending and commonly assigned application serial number 09/603,334, filed Jun. 26, 2000, entitled xe2x80x9cENHANCED GRAPHICAL DEVELOPMENT ENVIRONMENT FOR CONTROLLING PROGRAM FLOW; xe2x80x9d the disclosures of which are all hereby incorporated herein by reference.
In a preferred embodiment of the present invention, the main code of the program is written in a linear fashion that includes one or more frames. The program performs the functions defined in the frames while waiting for triggering events to occur. As an example, the main code may be a loop which performs an unlimited number or a set number of repetitive operations until interrupted by a triggering event. On the other hand, the main code frame may perform a function and then suspend until an event is detected. In some cases, the events may cause other programs to run, or they may provide data to other programs. In other cases, the events cause the program to exit the current code frame and to move on to another code frame or to end.
The present language can be graphically represented as having one or more frames of code to which events are associated or xe2x80x9cattached.xe2x80x9d The asynchronous events and their related actions may be referred to as xe2x80x9cdecorationsxe2x80x9d herein. An advantage of one aspect of a preferred embodiment of the present invention is the programmer""s ability to write the program main code in a linear fashion without initially accounting for any or all interrupting events. Events may then be attached to the main code frame to account for various states that may be detected by the program. Additionally, events may easily be added and/or modified from time to time without requiring extensive modification to the main code. That is, events may be added and/or modified from time to time within the decorations associated with the frames housing the main code for the program""s operation. For example, the main code may play a looping series of messages without any defined exit point. However, decorations may be added to the main program frame so that certain specifically defined events will cause the program to take appropriate actions, such as exiting the frame, performing another function, or ending its execution.
One feature that may be recognized by one aspect of a preferred embodiment is that a graphical programming language in which the main program flow is enclosed in one or more frames is provided. The program performs the operations defined by the main code in the frames. Asynchronous events, which affect the main code, are attached to the frames as xe2x80x9cdecorations.xe2x80x9d The decorations may cause the main code to move to another frame or to end, as examples. As further examples, the decorations may initiate other programs or perform particular functions.
Another feature that may be recognized by one aspect of a preferred embodiment is that a programming structure in which one or more frames may be nested within another frame with the nested frames inheriting the decorations of the primary (or xe2x80x9cmainxe2x80x9d or xe2x80x9cparentxe2x80x9d) frame is provided.
Yet another feature that may be recognized by one aspect of a preferred embodiment is that a programming structure that simplifies programming for concurrent operations or for asynchronous events is provided. Also, a preferred embodiment of the present invention enables programmers to easily update or modify existing code by changing the decorations associated with (e.g., connected to) each program frame.
The foregoing has outlined rather broadly the features and technical advantages of the present invention in order that the detailed description of the invention that follows may be better understood. Additional features and advantages of the invention will be described hereinafter which form the subject of the claims of the invention. It should be appreciated by those skilled in the art that the conception and specific embodiment disclosed may be readily utilized as a basis for modifying or designing other structures for carrying out the same purposes of the present invention. It should also be realized by those skilled in the art that such equivalent constructions do not depart from the spirit and scope of the invention as set forth in the appended claims. The novel features which are believed to be characteristic of the invention, both as to its organization and method of operation, together with further objects and advantages will be better understood from the following description when considered in connection with the accompanying figures. It is to be expressly understood, however, that each of the figures is provided for the purpose of illustration and description only and is not intended as a definition of the limits of the present invention.